package com.binest.toolInclusionMain.service.impl;

import java.util.List;
import com.binest.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.binest.toolInclusionMain.mapper.ToolInclusionMainMapper;
import com.binest.toolInclusionMain.domain.ToolInclusionMain;
import com.binest.toolInclusionMain.service.IToolInclusionMainService;

/**
 * 工具收录主Service业务层处理
 * 
 * @author wwd
 * @date 2024-01-22
 */
@Service
public class ToolInclusionMainServiceImpl implements IToolInclusionMainService 
{
    @Autowired
    private ToolInclusionMainMapper toolInclusionMainMapper;

    /**
     * 查询工具收录主
     * 
     * @param id 工具收录主主键
     * @return 工具收录主
     */
    @Override
    public ToolInclusionMain selectToolInclusionMainById(String id)
    {
        return toolInclusionMainMapper.selectToolInclusionMainById(id);
    }

    /**
     * 查询工具收录主列表
     * 
     * @param toolInclusionMain 工具收录主
     * @return 工具收录主
     */
    @Override
    public List<ToolInclusionMain> selectToolInclusionMainList(ToolInclusionMain toolInclusionMain)
    {
        return toolInclusionMainMapper.selectToolInclusionMainList(toolInclusionMain);
    }

    /**
     * 新增工具收录主
     * 
     * @param toolInclusionMain 工具收录主
     * @return 结果
     */
    @Override
    public int insertToolInclusionMain(ToolInclusionMain toolInclusionMain)
    {
        toolInclusionMain.setCreateTime(DateUtils.getNowDate());
        return toolInclusionMainMapper.insertToolInclusionMain(toolInclusionMain);
    }

    /**
     * 修改工具收录主
     * 
     * @param toolInclusionMain 工具收录主
     * @return 结果
     */
    @Override
    public int updateToolInclusionMain(ToolInclusionMain toolInclusionMain)
    {
        toolInclusionMain.setUpdateTime(DateUtils.getNowDate());
        return toolInclusionMainMapper.updateToolInclusionMain(toolInclusionMain);
    }

    /**
     * 批量删除工具收录主
     * 
     * @param ids 需要删除的工具收录主主键
     * @return 结果
     */
    @Override
    public int deleteToolInclusionMainByIds(String[] ids)
    {
        return toolInclusionMainMapper.deleteToolInclusionMainByIds(ids);
    }

    /**
     * 删除工具收录主信息
     * 
     * @param id 工具收录主主键
     * @return 结果
     */
    @Override
    public int deleteToolInclusionMainById(String id)
    {
        return toolInclusionMainMapper.deleteToolInclusionMainById(id);
    }

    @Override
    public int addLikeCount(String id) {
        return toolInclusionMainMapper.addLikeCount(id);
    }

    @Override
    public int reduceLikeCount(String id) {
        return toolInclusionMainMapper.reduceLikeCount(id);
    }

    @Override
    public int addNoLikeCount(String id) {
        return toolInclusionMainMapper.addNoLikeCount(id);
    }

    @Override
    public int reduceNoLikeCount(String id) {
        return toolInclusionMainMapper.reduceNoLikeCount(id);
    }
}
